<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 1] Introduction</TITLE>
<META NAME="author" CONTENT="Mark Grand and Jonathan Knudsen">
<META NAME="date" CONTENT="Fri Aug  8 16:06:32 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java Fundamental Classes Reference">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java Fundamental Classes Reference" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch00_07.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 1</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch01_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JFC-CH-1">1. Introduction</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
The java.lang Package<br>
<A HREF="ch01_02.htm">The java.lang.reflect Package</A><BR>
<A HREF="ch01_03.htm">The java.io Package</A><BR>
<A HREF="ch01_04.htm">The java.net Package</A><BR>
<A HREF="ch01_05.htm">The java.util Package</A><BR>
<A HREF="ch01_06.htm">The java.text Package</A><BR>
<A HREF="ch01_07.htm">The java.math Package</A><BR>
<A HREF="ch01_08.htm">The java.util.zip Package</A><BR>

<p>
</DIV>

<P CLASS=para>
The phenomenon that is Java continues to capture new supporters
every day. What began as a programming environment for
writing fancy animation applets that could be embedded in 
web browsers is growing up to be a sophisticated platform
for delivering all kinds of portable, distributed applications.
If you are already an experienced Java programmer, you know
just how powerful the portability of Java is. If you are just
now discovering Java, you'll be happy to know that the days
of porting applications are over. Once you write a Java
application, it can run on UNIX workstations, PCs, and Macintosh
computers, as well as on many other supported platforms.

<P CLASS=para>
This book is a complete programmer's reference to the 
"fundamental classes" in the Java programming environment.
The fundamental classes in the Java Development Kit (JDK)
provide a powerful set of
tools for creating portable applications; they are 
an important component of the toolbox used by every Java 
programmer. This reference covers the classes in the
<tt CLASS=literal>java.lang</tt>, <tt CLASS=literal>java.io</tt>,
<tt CLASS=literal>java.net</tt>, <tt CLASS=literal>java.util</tt>,
<tt CLASS=literal>java.lang.reflect</tt>, <tt CLASS=literal>java.math</tt>,
<tt CLASS=literal>java.text</tt>, and <tt CLASS=literal>java.util.zip</tt>
packages. This chapter offers an overview of the 
fundamental classes in each of these packages.

<P CLASS=para>
This reference assumes you are already familiar with the Java language
and class libraries. If you aren't, <I CLASS=emphasis>Exploring
Java</I>, by Pat Niemeyer and Josh Peck, provides a general
introduction, and other books in the O'Reilly Java series provide
detailed references and tutorials on specific topics.  Note that the
material herein does not cover the classes that comprise the Abstract
Window Toolkit (AWT): the AWT is covered by a companion volume, the
<I CLASS=emphasis>Java AWT Reference</I>, by John Zukowski. In
addition, this book does not cover any of the new "enterprise" APIs in
the core 1.1 JDK, such as the classes in the
<tt CLASS=literal>java.rmi</tt>, <tt CLASS=literal>java.sql</tt>, and
<tt CLASS=literal>java.security</tt> packages. These packages will be
covered by forthcoming books on distributed computing and database
programming.  See the Preface for a complete list of titles in the
O'Reilly Java series.

<P CLASS=para>
 
You should be aware that this book covers two versions of Java: 1.0.2
and 1.1. Version 1.1 of the Java Development Kit (JDK) was released in
February 1997. This release includes many improvements and additions
to the fundamental Java classes; it represents a major step forward in
the evolution of Java.  Although Java 1.1 has a number of great new
features, you may not want to switch to the new version right away,
especially if you are writing mostly Java applets. You'll need to keep
an eye on the state of Java support in browsers to help you decide
when to switch to Java 1.1. Of course, if you are writing Java
applications, you can take the plunge today.

<P CLASS=para>
This chapter points out new features of Java 1.1 as they 
come up. However, there is one "feature" that deserves mention 
that doesn't fit naturally into an overview. As of Java 1.1, 
classes, methods, and constructors available in Java 1.0.2 
can be deprecated in favor of new classes, methods, and constructors
in Java 1.1. The Java 1.1 compiler issues a warning whenever 
you use a deprecated entity.

<DIV CLASS=sect1>
<h2 CLASS=sect1><A CLASS="TITLE" NAME="JFC-CH-1-SECT-1">1.1 The java.lang Package</A></h2>

<P CLASS=para>
The <tt CLASS=literal>java.lang</tt> package contains classes and
interfaces essential to the Java language. For example,
the <tt CLASS=literal>Object</tt> class is the ultimate superclass of
all other classes in Java. <tt CLASS=literal>Object</tt> defines
some basic methods for thread synchronization that are inherited
by all Java classes. In addition, <tt CLASS=literal>Object</tt>
defines basic methods for equality testing, hashcode
generation, and string conversion that can be overridden by
subclasses when appropriate.

<P CLASS=para>
The <tt CLASS=literal>java.lang</tt> package also contains the
<tt CLASS=literal>Thread</tt> class, which controls the operation
of each thread in a multithreaded application. A
<tt CLASS=literal>Thread</tt> object can be used to 
start, stop, and suspend a thread. A <tt CLASS=literal>Thread</tt>
must be associated with an object that implements the
<tt CLASS=literal>Runnable</tt> interface; the <tt CLASS=literal>run()</tt>
method of this interface specifies what the thread actually does.
See <A HREF="ch03_01.htm">Chapter 3, <i>Threads</i></A>, for a more detailed explanation of how threads
work in Java.

<P CLASS=para>
The <tt CLASS=literal>Throwable</tt> class is the superclass of all
error and exception classes in Java, so it defines the basic
functionality of all such classes. The <tt CLASS=literal>java.lang</tt>
package also defines the standard error and exception classes
in Java. The error and exception hierarchies are rooted
at the <tt CLASS=literal>Error</tt> and <tt CLASS=literal>Exception</tt>
subclasses of <tt CLASS=literal>Throwable</tt>. See <A HREF="ch04_01.htm">Chapter 4, <i>Exception Handling</i></A>,
for more information about the exception-handling mechanism.

<P CLASS=para>

The <tt CLASS=literal>Boolean</tt>, <tt CLASS=literal>Character</tt>,
<tt CLASS=literal>Byte</tt>, <tt CLASS=literal>Double</tt>,
<tt CLASS=literal>Float</tt>, <tt CLASS=literal>Integer</tt>,
<tt CLASS=literal>Long</tt>, and <tt CLASS=literal>Short</tt> classes
encapsulate the Java primitive data types. <tt CLASS=literal>Byte</tt> and
<tt CLASS=literal>Short</tt> are new in Java 1.1, as is the
<tt CLASS=literal>Void</tt> class. All of these classes are necessary to
support the new Reflection API and class literals in Java 1.1 The
<tt CLASS=literal>Class</tt> class also has a number of new methods in
Java 1.1 to support reflection.  

<P CLASS=para>
All strings in Java are represented by <tt CLASS=literal>String</tt>
objects. These objects are immutable. The <tt CLASS=literal>StringBuffer</tt>
class in <tt CLASS=literal>java.lang</tt> can be used to work
with mutable text strings. <A HREF="ch02_01.htm">Chapter 2, <i>Strings and Related Classes</i></A>, offers a more detailed
description of working with strings in Java.

<P CLASS=para>
See <A HREF="ch12_01.htm">Chapter 12, <i>The java.lang Package</i></A>, for complete reference material on all of the
classes in the <tt CLASS=literal>java.lang</tt> package.

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch00_07.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch01_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Acknowledgments</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>The java.lang.reflect Package</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
